True color images are currently handled by packing 4bytes
in RGBA with A being the alpha channel (unused) with
red being the lowest byte. Again, there is no need to
know exactly how a packed pixel is represented, use
the following two routines (macros) to operate on a
particular truecolor pixel (rgba_t
is the packed pixel type):
extern rgba_t Pack(int red, int green, int blue);
extern void Unpack(rgba_t packed, int *red, int *green, int *blue);
Gray images in packed pixel format have a type of gray_t
,
which is the same as rgba_t
in the sense of packing
and unpacking.